<template>
	<el-select v-model="selectValue" v-bind="$attrs">
		<el-option v-for="(item, index) in dictDataArr" :key="index" :label="item.msg" :value="item.value"></el-option>
	</el-select>
</template>

<script>
import { mapGetters } from 'vuex';
export default {
	name: 'swDictSelect',
	props: {
		value: String,
		dictName: String
	},
	data() {
		return {
			selectValue: this.value
		};
	},
	computed: {
		...mapGetters(['dictEnums']),
		dictDataArr() {
			return this.dictEnums[this.dictName];
		}
	},
	watch: {
		value(val) {
			this.selectValue = val;
		},
		selectValue(val) {
			this.$emit('input', val);
		}
	},
	mounted() {},
	methods: {}
};
</script>

<style scoped></style>
